--- import translate from '$i18n/translate'; import tPage from '$i18n/translations/pages/news'; import Page from '$layouts/Page.astro'; import getLocaleFromPath from '$lib/getLocaleFromPath'; import localeStaticPaths from '$lib/localeStaticPaths'; import { getCollection } from 'astro:content'; import NewsPreviewLink from '$components/NewsPreviewLink.astro'; import { isNewsItemInLocale } from '$lib/newsUtils'; const allNews = await getCollection('news'); const locale = getLocaleFromPath(Astro.url.pathname); const allNewsInLocale = allNews.filter((item) => isNewsItemInLocale(item, locale)); const t = translate(locale); export async function getStaticPaths() { return localeStaticPaths; } ---

{t(tPage, { key: 'title' })}

{ allNewsInLocale.length > 0 ? ( allNewsInLocale.map((item) => ) ) : (

{t(tPage, { key: 'no-news' })}

) }